package com.school.controller;

import com.school.entity.AuditInfoRecord;
import com.school.service.AuditInfoRecordService;
import com.school.untils.ResultEntity;
import com.school.untils.ResultUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(tags = "审核记录信息管理")
@RestController
@RequestMapping("/auditInfoRecord")
public class AuditInfoRecordController {
    @Autowired
    AuditInfoRecordService auditInfoRecordService;

    // 增加
    @ApiOperation("审核信息增加")
    @RequestMapping(value = "/add",method = RequestMethod.POST)
    public ResultEntity addAuditIndoRecord(@RequestBody AuditInfoRecord auditInfoRecord){
        return  ResultUtils.build(auditInfoRecordService.addAuditIndoRecord(auditInfoRecord));
    }

    // 编辑
    @ApiOperation("审核信息编辑")
    @RequestMapping(value = "/update",method = RequestMethod.POST)
    public ResultEntity updateAuditIndoRecord(@RequestBody AuditInfoRecord auditInfoRecord){
        return  ResultUtils.build(auditInfoRecordService.updateAuditIndoRecord(auditInfoRecord));
    }

    // 根据申诉人ID查看
    @ApiOperation("审核记录信息根据申诉人ID查看")
    @RequestMapping(value = "/getListById/{complaintInfoId}",method = RequestMethod.GET)
    public ResultEntity getListByComplaintInfoId(@PathVariable("complaintInfoId") String complaintInfoId){
        return ResultUtils.build(auditInfoRecordService.getListByComplaintInfoId(complaintInfoId));
    }

    // 根据申诉记录ID，维度，分类查询申诉记录
    @ApiOperation("根据申诉记录ID，维度，分类查询申诉记录")
    @RequestMapping(value = "/getListByRecordInfo",method = RequestMethod.POST)
    public ResultEntity getListByRecordInfo(@RequestBody AuditInfoRecord auditInfoRecord){
        return ResultUtils.build(auditInfoRecordService.getListByRecordInfo(auditInfoRecord));
    }

}
